function addLyric(id) {
	var str = document.getElementById("imgbutton"+id).getAttribute("onclick");
    var re=/operate\((\d+)[^0-9]+(\d+)[^0-9]+(\d+),[^0-9a-zA-Z]+([0-9a-zA-Z]+)/;
    var arr=re.exec(str);
    var span = document.getElementById("title"+id);
    var artb=document.getElementById("performer"+id);
    var title_t=span.innerHTML.replace(/<[^>]+>/g,"");
    var title_a=artb.innerHTML.replace(/<[^>]+>/g,""); 
    var title=trim(title_a+" - "+title_t);   
    var newdiv=document.createElement("div");
    var addon=document.createElement("a");
    var addon1=document.createElement("a");
    var user=arr[3];
	addon.setAttribute("title",title);
    addon.setAttribute("alt", title);
    if (user<100000) {
		user=parseInt(user)+100000;
		user=(user.toString()).substr(1);
    }
    addon.setAttribute("href","http://cs"+arr[2]+".vkontakte.ru/u"+user+"/audio/"+arr[4]+".mp3");
    addon.innerHTML="\u0441\u043A\u0430\u0447\u0430\u0442\u044C";
    addon1.setAttribute("href","http://www.lyricsplugin.com/wmplayer03/plugin/?artist="+encodeURIComponent(title_a)+"&title="+encodeURIComponent(title_t));
    addon1.setAttribute("target","_blank");
    addon1.innerHTML="\u0442\u0435\u043A\u0441\u0442";
    newdiv.appendChild(addon);
	newdiv.innerHTML += " | ";
    newdiv.appendChild(addon1);
    newdiv.className="duration";
    artb.parentNode.parentNode.appendChild(newdiv);
}

function loadLyrics() 
{
	var parent = document.getElementById("results");
	if (!parent) {
		parent = document.getElementById("audios");
	}
	
	if(parent){
		var list = parent.childNodes;
    	var length = list.length;
    	var i = -1;
    	var re = /audio(\d+)/;
    	while(++i < length) {
        	if(list[i].nodeType == 1) {
				var m = list[i].id.match(re);
				if (m) {
					addLyric(m[1]);
				}
			}
		}
	} else {
		alert("This is not music page!");
	}
}